﻿
@using Apps.Web.Core;
@using Apps.Common;
@using Apps.Models.V;
@using Apps.Web;
@using Apps.Locale;
@using Apps.Models.Sys;
@using Apps.Models;
@{
    ViewBag.Title = "详情";
    var _path = Url.Content("~/");
    Layout = "~/Views/Shared/_Index_LayoutEdit.cshtml";
    List<permModel> perm = null;
    var fieldList = ViewBag.FieldList as HC_ITEM_FIELD_VO;
    var dtModel = ViewBag.FieldModel as System.Data.DataTable;
    var itemId = ViewBag.itemId as string;
    var formId = ViewBag.formId as string;
}
<script type="text/javascript">
    @*function updateState(id, templateid, state) {
        if (state != 4) {
            var arr = new Array();
            $("input:checkbox:checked").each(function (index, obj) {
                arr.push($(obj).val());
            });
            var vals = arr.join(",");
            var time = '@Checkitem[0].UPDATE_TIME';
            //更新状态
            $.ajax({
                url: "@(_path)LMS/TestDataAudit/UpdateState",
                type: "Post",
                data: { id: id, templateid: templateid, approval_status: state, vals: vals, updatetime: time },
                dataType: "json",
                success: function (data) {
                    //window.parent.frameReturnByMes(data.message);
                    //window.parent.frameReturnByReload(true);
                    //window.parent.frameReturnByClose()
                    window.parent.ReturnByMes(data.message);
                    window.parent.ReturnByReload(true);
                    window.parent.ReturnByClose()
                }
            });
        } else {
            window.parent.ReturnByMes("操作成功");
            window.parent.ReturnByReload(true);
            window.parent.ReturnByClose()
        }
    }*@
</script>
@Html.Hidden("itemId", @itemId)
@Html.Hidden("formId", @formId)
<table border="1" style="width:100%;margin:10px 5px 0px 5px">
    <tbody>
        <tr>
            <td colspan="10" style="height:30px;font-size:20px;text-align:center">首次化验结果</td>
        </tr>
        @for (int i = 0; i <= fieldList.fieldListVo.Count / 2; i++)
        {
            var filedValue = Utils.ObjectToStr(@fieldList.fieldListVo[i].ExtendFieldNAME);
            <tr>
                @for (int j = 0; j < (fieldList.fieldListVo.Count - i * 2 >= 2 ? 2 : fieldList.fieldListVo.Count - i * 2); j++)
                {
                    <td style="width:150px">
                        @(Utils.ObjectToStr(@fieldList.fieldListVo[2 * i + j].ExtendFieldTITLE))
                    </td>
                    <td>
                        <input class="easyui-textbox" type="text" name="name" style="width:100px" readonly="readonly" value="@dtModel.Rows[2 * i + j][filedValue]">
                    </td>
                }
            </tr>
        }
        @*<tr style="height:20px"></tr>
        <tr>
            <td colspan="10" style="height:30px;font-size:20px;text-align:center">复查化验结果</td>
        </tr>
        @for (int i = 0; i < targets.Count; i++)
        {
            var datas = Listitem.Where(a => a.INDEX_ID == targets[i]).OrderBy(a => a.TEST_TYPE).ToList();
            <tr>
                <th>
                    @(datas[0].INDEX_NAME + datas[0].INDEX_DISNAME + "(" + datas[0].INDEX_UNIT + ")")
                </th>
                <td colspan="10">
                    @for (int j = 0; j < datas.Count; j++)
                    {
                        @(datas[j].TEST_TYPE == 0 ? "最终值:" + datas[j].TEST_VALUE : "第" + (datas[j].TEST_TYPE - 10) + "次化验值:" + datas[j].TEST_VALUE)
                        <input type="checkbox" name="@datas[j].INDEX_ID" value="@(datas[j].INDEX_ID + "_" + datas[j].CONFIRMED_ID)" onclick="return @ViewBag.IsShow==1?true:false;">

                    }
                </td>
            </tr>
        }*@
    </tbody>
</table>
